private void Approval_Load(object sender, EventArgs e)
{
    // 确保审批单选按钮有默认值
    if (!radioTrue.Checked && !radioFalse.Checked)
    {
        radioTrue.Checked = true;
        textComment.Text = "通过";
    }

    // 确保是否结束流程单选按钮有默认值
    if (!radioIs_Final1.Checked && !radioIs_Final2.Checked)
    {
        radioIs_Final2.Checked = true; // 默认不结束流程
    }

    // 绑定事件处理程序
    radioTrue.CheckedChanged += radioApprove_CheckedChanged;
    radioFalse.CheckedChanged += radioApprove_CheckedChanged;
    radioIs_Final1.CheckedChanged += radioIs_Final_CheckedChanged;
    radioIs_Final2.CheckedChanged += radioIs_Final_CheckedChanged;

    // 初始化下一个审批人下拉框可见性
    UpdateApproverComboBoxVisibility();
}

// 添加是否结束流程单选按钮的事件处理方法
private void radioIs_Final_CheckedChanged(object sender, EventArgs e)
{
    UpdateApproverComboBoxVisibility();
    // 确保审批单选按钮状态不变
    EnsureApprovalRadioState();
}

// 确保审批单选按钮始终有一个选中项
private void EnsureApprovalRadioState()
{
    if (!radioTrue.Checked && !radioFalse.Checked)
    {
        // 如果都未选中，默认选择"通过"
        radioTrue.Checked = true;
        textComment.Text = "通过";
    }
}

// 原来的审批单选按钮事件处理方法
private void radioApprove_CheckedChanged(object sender, EventArgs e)
{
    if (radioTrue.Checked)
    {
        textComment.Text = "通过";
    }
    else if (radioFalse.Checked)
    {
        textComment.Text = "驳回";
        // 驳回时强制结束流程
        radioIs_Final1.Checked = true;
    }
}

// 控制下一个审批人下拉框可见性的方法
private void UpdateApproverComboBoxVisibility()
{
    bool isFinal = radioIs_Final1.Checked;
    comRequest_Ddte.Visible = !isFinal;
    // 假设标签控件名为labelNextApprover
    // labelNextApprover.Visible = !isFinal;
}

private void button1_Click(object sender, EventArgs e)
{
    // 构造审批数据
    // 确保以下字段存在且名称正确
    // 收集表单数据
    var approvalData = new
    {
        Reqest_No = purchaseNo,
        Result = comResult.SelectedValue?.ToString() ?? "",  // 确保是字符串类型
        Comment = textComment.Text,
        Is_Final = radioIs_Final1.Checked,  // radioIs_Final1为"是"，radioIs_Final2为"否"
        NextApproverId = radioIs_Final1.Checked ? null : (int?)comRequest_Ddte.SelectedValue,
        command = "Approve"  // 确保包含必需的command字段
    };

    // 序列化数据为JSON
    string jsonData = JsonConvert.SerializeObject(approvalData);

    // 输出JSON数据以便调试（可选）
    Console.WriteLine("提交的数据: " + jsonData);
}